package com.lxf.cloudcar.mapper;

import com.lxf.cloudcar.bean.UserCarBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 罗兴发
 * @data 2025/7/29 16:15
 * @description：用户购物车-持久层
 */
@Mapper
public interface UserCarMapper {

    int addCar(@Param("list") List<UserCarBean> list);

    UserCarBean getCarByGoodCode(@Param("goodCode") String goodCode,
                                 @Param("userId") Integer userId);

    int delCarById(@Param("carId") Integer carId);

    List<UserCarBean> getCarByUserId(@Param("userId") Integer userId);

    int updateCarNumById(@Param("carId") Integer carId,
                         @Param("goodNum") Integer goodNum);

    UserCarBean getCarById(@Param("carId") Integer carId);
}
